<?php
require_once('../phplib/include.inc.php');

class TypeAdmin extends PageBase{
	public function Ini(){
		PageBase::RequireLogin();
		$this->GetTypes();
		$this->GetRight();
	}
	public function GetTypes(){
		$db = getDb();
		$db->connect();
		$types = $db->fetch("SELECT * FROM type_t");
		$this->assign('types',$types);
	}
	public function GetRight(){
		$this->assign('canaddtype',Util::HaveRight_Or(array(1,3)));
		$this->assign('canmodifytype',Util::HaveRight_Or(array(1,4)));
		$this->assign('candeletetype',Util::HaveRight_Or(array(1,5)));
	}
}
$typeadmin = new TypeAdmin("file:".dirname(__FILE__)."/../home/typeadmin.tpl.html");
$typeadmin->display();
?>